﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SiteTemplate.Master" AutoEventWireup="true"
    CodeBehind="Search.aspx.cs" Inherits="carportal.Search" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
 
<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
  
             <asp:UpdatePanel ID="UpdatePanel1" runat="server" class="container_12" style="float: left;">
                 <ContentTemplate>
                 
                <table><tr><td>
     <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:bestgifts4usConnectionString %>" 
                        SelectCommand="SELECT * FROM [carportal_search_cars] where id = @searchid" InsertCommand="INSERT INTO carportal_search_cars(searched_user, 
make, 
model, 
model_by_user, 
car_type, 
engine_power, 
first_reg_date, 
fuel_type, 
gearbox, 
price_from, 
price_to, 
country_code, 
location_city, 
climate_control, 
seat_count, 
color, 
door_count, 
Auxiliary_heating, 
Central_locking, 
Cruise_control, 
Electric_heated, 
Electric_windows, 
Leather_seats, 
Parking_sensors, 
Power_Steering, 
Sunroof, 
Four_wheel_drive, 
Immobilizer, 
Xenon_headlights, 
ABS, 
ESP, 
user_comments, 
first_reg_year_from, 
first_reg_year_to, 
make0, 
model0, 
make1, 
model1, 
make2, 
model2, 
cartype1, 
cartype2, 
cartype3, 
cartype4, 
cartype5, 
cartype6, 
cartype7, 
cartype8, 
millage_km_to, 
millage_km_from)

select 
searched_user, 
make, 
model, 
model_by_user, 
car_type, 
engine_power, 
first_reg_date, 
fuel_type, 
gearbox, 
price_from, 
price_to, 
country_code, 
location_city, 
climate_control, 
seat_count, 
color, 
door_count, 
Auxiliary_heating, 
Central_locking, 
Cruise_control, 
Electric_heated, 
Electric_windows, 
Leather_seats, 
Parking_sensors, 
Power_Steering, 
Sunroof, 
Four_wheel_drive, 
Immobilizer, 
Xenon_headlights, 
ABS, 
ESP, 
user_comments, 
first_reg_year_from, 
first_reg_year_to, 
make0, 
model0, 
make1, 
model1, 
make2, 
model2, 
cartype1, 
cartype2, 
cartype3, 
cartype4, 
cartype5, 
cartype6, 
cartype7, 
cartype8, 
millage_km_to, 
millage_km_from

 


VALUES 
(@searched_user, 
@make, 
@model, 
@model_by_user, 
@car_type, 
@engine_power, 
@first_reg_date, 
@fuel_type, 
@gearbox, 
@price_from, 
@price_to, 
@country_code, 
@location_city, 
@climate_control, 
@seat_count, 
@color, 
@door_count, 
@Auxiliary_heating, 
@Central_locking, 
@Cruise_control, 
@Electric_heated, 
@Electric_windows, 
@Leather_seats, 
@Parking_sensors, 
@Power_Steering, 
@Sunroof, 
@Four_wheel_drive, 
@Immobilizer, 
@Xenon_headlights, 
@ABS, 
@ESP, 
@user_comments, 
@first_reg_year_from, 
@first_reg_year_to, 
@make0, 
@model0, 
@make1, 
@model1, 
@make2, 
@model2, 
@cartype1, 
@cartype2, 
@cartype3, 
@cartype4, 
@cartype5, 
@cartype6, 
@cartype7, 
@cartype8,@millage_km_from,@millage_km_to);
SELECT  @SearchID = SCOPE_IDENTITY(); 
">
                        <InsertParameters>
                            <asp:Parameter Name="searched_user" />
                            <asp:Parameter Name="make" />
                            <asp:Parameter Name="model" />
                            <asp:Parameter Name="model_by_user" />
                            <asp:Parameter Name="car_type" />
                            <asp:Parameter Name="engine_power" />
                            <asp:Parameter Name="first_reg_date" />
                            <asp:Parameter Name="fuel_type" />
                            <asp:Parameter Name="gearbox" />
                            <asp:Parameter Name="price_from" />
                            <asp:Parameter Name="price_to" />
                            <asp:Parameter Name="country_code" />
                            <asp:Parameter Name="location_city" />
                            <asp:Parameter Name="climate_control" />
                            <asp:Parameter Name="seat_count" />
                            <asp:Parameter Name="color" />
                            <asp:Parameter Name="door_count" />
                            <asp:Parameter Name="Auxiliary_heating" />
                            <asp:Parameter Name="Central_locking" />
                            <asp:Parameter Name="Cruise_control" />
                            <asp:Parameter Name="Electric_heated" />
                            <asp:Parameter Name="Electric_windows" />
                            <asp:Parameter Name="Leather_seats" />
                            <asp:Parameter Name="Parking_sensors" />
                            <asp:Parameter Name="Power_Steering" />
                            <asp:Parameter Name="Sunroof" />
                            <asp:Parameter Name="Four_wheel_drive" />
                            <asp:Parameter Name="Immobilizer" />
                            <asp:Parameter Name="Xenon_headlights" />
                            <asp:Parameter Name="ABS" />
                            <asp:Parameter Name="ESP" />
                            <asp:Parameter Name="user_comments" />
                            <asp:Parameter Name="first_reg_year_from" />
                            <asp:Parameter Name="first_reg_year_to" />
                            <asp:Parameter Name="make0" />
                            <asp:Parameter Name="model0" />
                            <asp:Parameter Name="make1" />
                            <asp:Parameter Name="model1" />
                            <asp:Parameter Name="make2" />
                            <asp:Parameter Name="model2" />
                            <asp:Parameter Name="cartype1" />
                            <asp:Parameter Name="cartype2" />
                            <asp:Parameter Name="cartype3" />
                            <asp:Parameter Name="cartype4" />
                            <asp:Parameter Name="cartype5" />
                            <asp:Parameter Name="cartype6" />
                            <asp:Parameter Name="cartype7" />
                            <asp:Parameter Name="cartype8" />
                            <asp:Parameter Name="millage_km_from" />
                            <asp:Parameter Name="millage_km_to" />
                            <asp:Parameter Name="SearchID" />
                        </InsertParameters>
                        <SelectParameters>
                            <asp:SessionParameter Name="searchid" SessionField="SearchID" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="SqlDataSourceVechicleTypes" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:bestgifts4usConnectionString %>" 
                        SelectCommand="SELECT [id], [vehicletype] FROM [carportal_vehicletypes]">
                    </asp:SqlDataSource>
                     <div style="background-color:White;border-width:2px;border-style:Groove;width:210px; font-weight: 700;">ADJUST <span class="color-3">SEARCH</span>

                        <hr /> 
                    
                    <asp:FormView ID="FormView1" runat="server" DataKeyNames="id" 
                                DataSourceID="SqlDataSource2" onitemupdated="FormView1_ItemUpdated">
                       
                      <EditItemTemplate>
                       Gearbox:<br />
                    <asp:DropDownList ID="DropDownListGearbox" runat="server" meta:resourcekey="DropDownList8Resource1"
                        SelectedValue='<%# Bind("gearbox") %>' Width="175px" AutoPostBack="True">
                                 <asp:ListItem  Value="-1">Does not metter</asp:ListItem>
                                 <asp:ListItem Value="Manual">Manual</asp:ListItem>
                                 <asp:ListItem Value="Automatic">Automatic</asp:ListItem>
                                 <asp:ListItem Value="TipTronic">TipTronic</asp:ListItem>
                                 <asp:ListItem Value="Other">Other</asp:ListItem>
                      </asp:DropDownList>
                    <br /> 
                    Doors:
                    <br />
                    <asp:DropDownList ID="DropDownListSeatcount" runat="server" meta:resourcekey="DropDownList9Resource1"
                        SelectedValue='<%# Eval("door_count") %>' Width="175px" 
                        AutoPostBack="True">
                        <asp:ListItem Value="-1">Any</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource33">2</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource34">4</asp:ListItem>
                        <asp:ListItem>5</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource35">6</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource36">7</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource37">8</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource38">More</asp:ListItem>
                    </asp:DropDownList>
                    <br />
                      </EditItemTemplate>

                        <ItemTemplate>
               <table>
            <tr>
                <td colspan="2">

                    <table style="width: 100%">
                        <tr>
                            <td>
                                Min Year:<br />
                                <asp:DropDownList ID="DropDownListRegFrom" runat="server" AutoPostBack="True" 
                                    meta:resourcekey="DropDownList8Resource1" Width="80px">
                                    <asp:ListItem meta:resourcekey="ListItemResource1">2012</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource2">2011</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource3">2010</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource4">2009</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource5">2008</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource6">2007</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource7">2006</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource8">2005</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource9">2004</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource10">2003</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource11">2002</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource12">2001</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource13" Selected="True">2000</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>
                                Max Year:<br />
                                <asp:DropDownList ID="DropDownListRegTo" runat="server" AutoPostBack="True" 
                                    meta:resourcekey="DropDownList9Resource1" Width="80px">
                                    <asp:ListItem meta:resourcekey="ListItemResource1">2012</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource2">2011</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource3">2010</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource4">2009</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource5">2008</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource6">2007</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource7">2006</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource8">2005</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource9">2004</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource10">2003</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource11">2002</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource12">2001</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource13">2000</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Min Price:<br />
                                <asp:DropDownList ID="DropDownListPriceFrom" runat="server" AutoPostBack="True" 
                                    meta:resourcekey="DropDownList5Resource1" Width="80px">
                                    <asp:ListItem>0</asp:ListItem>
                                    <asp:ListItem>300</asp:ListItem>
                                    <asp:ListItem>400</asp:ListItem>
                                    <asp:ListItem>500</asp:ListItem>
                                    <asp:ListItem>600</asp:ListItem>
                                    <asp:ListItem>700</asp:ListItem>
                                    <asp:ListItem>800</asp:ListItem>
                                    <asp:ListItem>900</asp:ListItem>
                                    <asp:ListItem>1000</asp:ListItem>
                                    <asp:ListItem>1100</asp:ListItem>
                                    <asp:ListItem>1200</asp:ListItem>
                                    <asp:ListItem>1300</asp:ListItem>
                                    <asp:ListItem>1400</asp:ListItem>
                                    <asp:ListItem>1500</asp:ListItem>
                                    <asp:ListItem>1600</asp:ListItem>
                                    <asp:ListItem>1700</asp:ListItem>
                                    <asp:ListItem>1800</asp:ListItem>
                                    <asp:ListItem>1900</asp:ListItem>
                                    <asp:ListItem>2000</asp:ListItem>
                                    <asp:ListItem>2500</asp:ListItem>
                                    <asp:ListItem>3000</asp:ListItem>
                                    <asp:ListItem>3500</asp:ListItem>
                                    <asp:ListItem>4000</asp:ListItem>
                                    <asp:ListItem>4500</asp:ListItem>
                                    <asp:ListItem>5000</asp:ListItem>
                                    <asp:ListItem>5500</asp:ListItem>
                                    <asp:ListItem>6000</asp:ListItem>
                                    <asp:ListItem>6500</asp:ListItem>
                                    <asp:ListItem>7000</asp:ListItem>
                                    <asp:ListItem>7500</asp:ListItem>
                                    <asp:ListItem>8000</asp:ListItem>
                                    <asp:ListItem>8500</asp:ListItem>
                                    <asp:ListItem>9000</asp:ListItem>
                                    <asp:ListItem>9500</asp:ListItem>
                                    <asp:ListItem>10000</asp:ListItem>
                                    <asp:ListItem>10500</asp:ListItem>
                                    <asp:ListItem>11000</asp:ListItem>
                                    <asp:ListItem>11500</asp:ListItem>
                                    <asp:ListItem>12000</asp:ListItem>
                                    <asp:ListItem>12500</asp:ListItem>
                                    <asp:ListItem>13000</asp:ListItem>
                                    <asp:ListItem>13500</asp:ListItem>
                                    <asp:ListItem>14000</asp:ListItem>
                                    <asp:ListItem>14500</asp:ListItem>
                                    <asp:ListItem>15000</asp:ListItem>
                                    <asp:ListItem>15500</asp:ListItem>
                                    <asp:ListItem>16000</asp:ListItem>
                                    <asp:ListItem>16500</asp:ListItem>
                                    <asp:ListItem>17000</asp:ListItem>
                                    <asp:ListItem>17500</asp:ListItem>
                                    <asp:ListItem>18000</asp:ListItem>
                                    <asp:ListItem>18500</asp:ListItem>
                                    <asp:ListItem>19000</asp:ListItem>
                                    <asp:ListItem>19500</asp:ListItem>
                                    <asp:ListItem>20000</asp:ListItem>
                                </asp:DropDownList>
                                <br />
                            </td>
                            <td>
                                Max Price:<br />
                                <asp:DropDownList ID="DropDownListPriceTo" runat="server" AutoPostBack="True" 
                                    meta:resourcekey="DropDownList6Resource1" Width="80px">
                                    <asp:ListItem>30001</asp:ListItem>
                                    <asp:ListItem>40001</asp:ListItem>
                                    <asp:ListItem>50001</asp:ListItem>
                                    <asp:ListItem>60001</asp:ListItem>
                                    <asp:ListItem>70001</asp:ListItem>
                                    <asp:ListItem>80001</asp:ListItem>
                                    <asp:ListItem>90001</asp:ListItem>
                                    <asp:ListItem>100001</asp:ListItem>
                                    <asp:ListItem>120001</asp:ListItem>
                                    <asp:ListItem>140001</asp:ListItem>
                                    <asp:ListItem>160001</asp:ListItem>
                                    <asp:ListItem>180001</asp:ListItem>
                                    <asp:ListItem>200001</asp:ListItem>
                                    <asp:ListItem>220001</asp:ListItem>
                                    <asp:ListItem>240001</asp:ListItem>
                                    <asp:ListItem>260001</asp:ListItem>
                                    <asp:ListItem>280001</asp:ListItem>
                                    <asp:ListItem>300001</asp:ListItem>
                                    <asp:ListItem>&gt;300001</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Km From:<br />
                                <asp:DropDownList ID="DropDownListMillageFrom" runat="server" 
                                    AutoPostBack="True" meta:resourcekey="DropDownList11Resource1" Width="80px">
                                    <asp:ListItem meta:resourcekey="ListItemResource1">2012</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource2">2011</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource3">2010</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource4">2009</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource5">2008</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource6">2007</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource7">2006</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource8">2005</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource9">2004</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource10">2003</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource11">2002</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource12">2001</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource13" Selected="True">2000</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>
                                Km Until:<br />
                                <asp:DropDownList ID="DropDownListMillageTo" runat="server" AutoPostBack="True" 
                                    meta:resourcekey="DropDownList12Resource1" Width="80px">
                                    <asp:ListItem meta:resourcekey="ListItemResource1">2012</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource2">2011</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource3">2010</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource4">2009</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource5">2008</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource6">2007</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource7">2006</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource8">2005</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource9">2004</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource10">2003</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource11">2002</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource12">2001</asp:ListItem>
                                    <asp:ListItem meta:resourcekey="ListItemResource13">2000</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                    </table>
                    Body Type:<br />
                    <asp:DropDownList ID="DropDownList3" runat="server" 
                        DataSourceID="SqlDataSourceVechicleTypes" DataTextField="vehicletype" 
                        DataValueField="id" Width="175px">
                    </asp:DropDownList>
                    <br />
                    Fuel:<br />
                    <asp:DropDownList ID="DropDownList2" runat="server" Width="175px">
                    </asp:DropDownList>
                    <br />
                    Gearbox:<br />
                    <asp:DropDownList ID="DropDownListGearbox" runat="server" meta:resourcekey="DropDownList8Resource1"
                        SelectedValue='<%# Bind("gearbox") %>' Width="175px" AutoPostBack="True">
                                 <asp:ListItem  Value="-1">Does not metter</asp:ListItem>
                                 <asp:ListItem Value="Manual">Manual</asp:ListItem>
                                 <asp:ListItem Value="Automatic">Automatic</asp:ListItem>
                                 <asp:ListItem Value="TipTronic">TipTronic</asp:ListItem>
                                 <asp:ListItem Value="Other">Other</asp:ListItem>
                      </asp:DropDownList>
                    <br /> 
                    Doors:
                    <br />
                    <asp:DropDownList ID="DropDownListSeatcount" runat="server" meta:resourcekey="DropDownList9Resource1"
                        SelectedValue='<%# Eval("door_count") %>' Width="175px" 
                        AutoPostBack="True">
                        <asp:ListItem Value="-1">Any</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource33">2</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource34">4</asp:ListItem>
                        <asp:ListItem>5</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource35">6</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource36">7</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource37">8</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource38">More</asp:ListItem>
                    </asp:DropDownList>
                    <br />
                    Seats:<br />
                    <asp:DropDownList ID="DropDownListDorrCount" runat="server" meta:resourcekey="DropDownList10Resource1"
                        SelectedValue='<%# Bind("seat_count") %>' Width="175px" 
                        AutoPostBack="True">
                        <asp:ListItem Value="-1">Any</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource39">2</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource40">3</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource41">4</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource42">5</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource43">6</asp:ListItem>
                        <asp:ListItem meta:resourcekey="ListItemResource44">7</asp:ListItem>
                    </asp:DropDownList>
                    <br />
                    Clima:
                    <br />
                    <asp:DropDownList ID="DropDownListClima" runat="server" 
                        meta:resourcekey="DropDownList8Resource1"     
                        SelectedValue='<%# Bind("climate_control") %>' Width="175px" 
                        AutoPostBack="True">
                        <asp:ListItem Value="0">No</asp:ListItem>
                        <asp:ListItem Value="1">Automatic</asp:ListItem>
                        <asp:ListItem Value="2">Manual</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td style="width: 126px">
                    Auxiliary Heating:
                    <asp:Label ID="Label1" runat="server" Text=''></asp:Label>
                </td>
                <td>
                    <asp:CheckBox ID="Auxiliary_heatingCheckBox" runat="server" 
                        Checked='<%# Bind("Auxiliary_heating") %>' AutoPostBack="True" />
                </td>
            </tr>
            <tr>
                <td>
                    Central Locking:
                </td>
                <td>
                    <asp:CheckBox ID="Central_lockingCheckBox" runat="server" 
                        Checked='<%# Bind("Central_locking") %>' AutoPostBack="True" />
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    Cruise Control:
                </td>
                <td>
                    <asp:CheckBox ID="Cruise_controlCheckBox" runat="server" 
                        Checked='<%# Bind("Cruise_control") %>' AutoPostBack="True" />
                </td>
            </tr>
            <tr>
                <td>
                    Electric Heated:
                </td>
                <td>
                    <asp:CheckBox ID="Electric_heatedCheckBox" runat="server" 
                        Checked='<%# Bind("Electric_heated") %>' AutoPostBack="True" />
                </td>
            </tr>
            <tr>
                <td>
                    Electric Windows:
                </td>
                <td>
                    <asp:CheckBox ID="Electric_windowsCheckBox" runat="server" 
                        Checked='<%# Bind("Electric_windows") %>' AutoPostBack="True" />
                </td>
            </tr>
            <tr>
                <td>
                    Leather Seats:
                </td>
                <td>
                    <asp:CheckBox ID="Leather_seatsCheckBox" runat="server" 
                        Checked='<%# Bind("Leather_seats") %>' AutoPostBack="True" />
                </td>
            </tr>
            <tr>
                <td>
                    Parking Sensors:
                </td>
                <td>
                    <asp:CheckBox ID="Parking_sensorsCheckBox" runat="server" 
                        Checked='<%# Bind("Parking_sensors") %>' AutoPostBack="True" />
                </td>
            </tr>
            <tr>
                <td>
                    Power Steering:
                </td>
                <td>
                    <asp:CheckBox ID="Power_SteeringCheckBox" runat="server" 
                        Checked='<%# Bind("Power_Steering") %>' AutoPostBack="True" />
                </td>
            </tr>
            <tr>
                <td>
                    Sunroof:
                </td>
                <td>
                    <asp:CheckBox ID="SunroofCheckBox" runat="server" 
                        Checked='<%# Bind("Sunroof") %>' AutoPostBack="True" />
                </td>
            </tr>
            <tr>
                <td>
                    Four Wheel Drive:
                </td>
                <td>
                    <asp:CheckBox ID="Four_wheel_driveCheckBox" runat="server" 
                        Checked='<%# Bind("Four_wheel_drive") %>' AutoPostBack="True" />
                </td>
            </tr>
            <tr>
                <td>
                    Immobilizer:
                </td>
                <td>
                    <asp:CheckBox ID="ImmobilizerCheckBox" runat="server" 
                        Checked='<%# Bind("Immobilizer") %>' AutoPostBack="True" />
                </td>
            </tr>
            <tr>
                <td>
                    Xenon Headlights:
                </td>
                <td>
                    <asp:CheckBox ID="Xenon_headlightsCheckBox" runat="server" 
                        Checked='<%# Bind("Xenon_headlights") %>' AutoPostBack="True" />
                </td>
            </tr>
            <tr>
                <td>
                    ABS:
                </td>
                <td>
                    <asp:CheckBox ID="ABSCheckBox" runat="server" Checked='<%# Bind("ABS") %>' 
                        AutoPostBack="True" />
                </td>
            </tr>
            <tr>
                <td>
                    ESP:
                </td>
                <td>
                    <asp:CheckBox ID="ESPCheckBox" runat="server" Checked='<%# Bind("ESP") %>' 
                        AutoPostBack="True" />
                </td>
            </tr> 
                                <tr><td>Limousine</td><td>
                                      <asp:CheckBox ID="cartype1CheckBox" Text="" runat="server" 
                                Checked='<%# Bind("cartype1") %>' TextAlign="Left" AutoPostBack="True"/>
                            </td></tr><tr><td>Small Car</td><td>
                             <asp:CheckBox ID="cartype2CheckBox" Text="" runat="server" 
                                Checked='<%# Bind("cartype2") %>' TextAlign="Left" AutoPostBack="True" />
                            </td></tr><tr><td>Estate Car</td><td>
                             <asp:CheckBox ID="cartype3CheckBox" Text="" runat="server" 
                                Checked='<%# Bind("cartype3") %>' TextAlign="Left" AutoPostBack="True" />
                            </td></tr><tr><td>Van / Minibus</td><td>
                             <asp:CheckBox ID="cartype4CheckBox" Text="" runat="server" 
                                Checked='<%# Bind("cartype4") %>' TextAlign="Left" AutoPostBack="True" />
                            </td></tr><tr><td>Off-road Vehicle/Pickup</td><td>
                             <asp:CheckBox ID="cartype5CheckBox" Text="" runat="server" 
                                Checked='<%# Bind("cartype5") %>' TextAlign="Left" AutoPostBack="True" />
                            </td></tr><tr><td>Cabrio / roadster</td><td>
                             <asp:CheckBox ID="cartype6CheckBox" Text="" runat="server" 
                                Checked='<%# Bind("cartype6") %>' TextAlign="Left" AutoPostBack="True" />
                            </td></tr><tr><td>Sports car/Coupe</td><td>
                             <asp:CheckBox ID="cartype7CheckBox" Text="" runat="server" 
                                Checked='<%# Bind("cartype7") %>' TextAlign="Left" AutoPostBack="True" />
                            </td></tr><tr><td>Other</td><td>
                             <asp:CheckBox ID="cartype8CheckBox" Text="" runat="server" 
                                Checked='<%# Bind("cartype8") %>' TextAlign="Left" AutoPostBack="True" />
                                    </td>
                                    
                                </tr>
                            </table>
        <br /><br /><br />
                              
      
                        </ItemTemplate>
                    </asp:FormView> 
                     </div>
                    </td><td>
    </p></div>
    <div class="container_12" style="width: 485px;float: left; margin-left: -12px;" >                             	 
                    <asp:SqlDataSource ID="SqlDataSourceSearch_result" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:bestgifts4usConnectionString %>" 
                    SelectCommand="SELECT carportal_cars.id, carportal_cars.user_id, carportal_cars.make, carportal_cars.model, carportal_cars.model_by_user, carportal_cars.car_type, carportal_cars.engine_power, carportal_cars.first_reg_date, carportal_cars.millage_km, carportal_cars.fuel_type, carportal_cars.gearbox, carportal_cars.price, carportal_cars.country_code, carportal_cars.location_city, carportal_cars.climate_control, carportal_cars.seat_count, carportal_cars.color, carportal_cars.door_count, carportal_cars.Auxiliary_heating, carportal_cars.Central_locking, carportal_cars.Cruise_control, carportal_cars.Electric_heated, carportal_cars.Electric_windows, carportal_cars.Leather_seats, carportal_cars.Parking_sensors, carportal_cars.Power_Steering, carportal_cars.Sunroof, carportal_cars.Four_wheel_drive, carportal_cars.Immobilizer, carportal_cars.Xenon_headlights, carportal_cars.ABS, carportal_cars.ESP, carportal_cars.user_comments, carportal_make.id AS Expr1, carportal_make.make_name, carportal_model.id AS Expr2, carportal_model.make_id, carportal_countries.id AS Expr4, carportal_countries.countrycode, carportal_countries.countryname, carportal_vehicletypes.id AS Expr5, carportal_vehicletypes.vehicletype, carportal_search_cars.id AS Expr6, carportal_search_cars.searched_user, carportal_search_cars.make AS Expr7, carportal_search_cars.model AS Expr8, 
                    carportal_search_cars.model_by_user AS Expr9, carportal_search_cars.car_type AS Expr10, carportal_search_cars.engine_power AS Expr11, carportal_search_cars.first_reg_date AS Expr12, carportal_search_cars.millage_km_from AS Expr13, carportal_search_cars.fuel_type AS Expr14, carportal_search_cars.gearbox AS Expr15, carportal_search_cars.price_from, carportal_search_cars.price_to, carportal_search_cars.country_code AS Expr16, carportal_search_cars.location_city AS Expr17, carportal_search_cars.climate_control AS Expr18, carportal_search_cars.seat_count AS Expr19, carportal_search_cars.color AS Expr20, carportal_search_cars.door_count AS Expr21, carportal_search_cars.Auxiliary_heating AS Expr22, carportal_search_cars.Central_locking AS Expr23, carportal_search_cars.Cruise_control AS Expr24, carportal_search_cars.Electric_heated AS Expr25, carportal_search_cars.Electric_windows AS Expr26, carportal_search_cars.Leather_seats AS Expr27, carportal_search_cars.Parking_sensors AS Expr28, carportal_search_cars.Power_Steering AS Expr29, carportal_search_cars.Sunroof AS Expr30, carportal_search_cars.Four_wheel_drive AS Expr31, carportal_search_cars.Immobilizer AS Expr32, carportal_search_cars.Xenon_headlights AS Expr33, carportal_search_cars.ABS AS Expr34, carportal_search_cars.ESP AS Expr35, carportal_search_cars.user_comments AS Expr36,
                     carportal_search_cars.first_reg_year_from, carportal_search_cars.first_reg_year_to, carportal_model.model AS modelname,
                     carportal_make.make_name as makename 
                     FROM carportal_cars 
                     INNER JOIN carportal_make ON carportal_cars.make = carportal_make.id 
                     INNER JOIN carportal_model ON carportal_cars.model = carportal_model.id 
                     INNER JOIN carportal_countries ON carportal_cars.country_code = carportal_countries.id 
                     INNER JOIN carportal_vehicletypes ON carportal_cars.car_type = carportal_vehicletypes.id 
                     INNER JOIN carportal_search_cars ON
                         1 = 1 AND carportal_search_cars.id=@SearchID 
                                AND (carportal_cars.make = carportal_search_cars.make0 OR 
                                    carportal_search_cars.make0 = - 1)
                                AND (carportal_cars.model = carportal_search_cars.model0 OR
                                 carportal_search_cars.model0 = - 1 OR
                                 carportal_search_cars.model0 is null )  
                                AND (carportal_cars.car_type in(carportal_search_cars.cartype1,carportal_search_cars.cartype2*2,carportal_search_cars.cartype3*3,carportal_search_cars.cartype4*4,carportal_search_cars.cartype5*5,carportal_search_cars.cartype6*6 )  OR 
                                 carportal_search_cars.car_type = - 1) 
                                AND (carportal_cars.gearbox = carportal_search_cars.gearbox OR
                                 carportal_search_cars.gearbox = '-1') 
                                AND carportal_cars.price BETWEEN carportal_search_cars.price_from AND carportal_search_cars.price_to 
                                AND carportal_cars.first_reg_date BETWEEN carportal_search_cars.first_reg_year_from AND carportal_search_cars.first_reg_year_to ">
                    <SelectParameters>
                                <asp:SessionParameter Name="searchid" SessionField="SearchID" />
                    </SelectParameters>
                </asp:SqlDataSource>

<div>
        <div class="alignright">
            <div class="alignright"  style="margin-top: 10px;vertical-align: middle;">
        Sort by:<asp:DropDownList ID="DropDownList1" runat="server">
                    <asp:ListItem>Price</asp:ListItem>
                    <asp:ListItem>Registration Date</asp:ListItem>
                    <asp:ListItem>Millage</asp:ListItem>
            </asp:DropDownList>

           <br /> 
            </div>
      <asp:ListView ID="ListView2" runat="server" DataKeyNames="id,Expr1,Expr2,Expr4,Expr5,Expr6"
                DataSourceID="SqlDataSourceSearch_result">
                <EmptyDataTemplate>
                    <table runat="server" style="">
                        <tr>
                            <td>
                                No data was returned.
                            </td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <EmptyItemTemplate>
                    <td runat="server" />
                </EmptyItemTemplate>
                <GroupTemplate>
                    <tr id="itemPlaceholderContainer" runat="server">
                        <td id="itemPlaceholder" runat="server">
                        </td>
                    </tr>
                </GroupTemplate>
                <ItemTemplate>
                    <div class="tab-col tab-col-indent" style="width: 475px;">
                        <span class="block mb5" style="margin-left: 10px;"><a class="link-2" href="carview.aspx?carid=<%# Eval("id") %>">
                            <asp:Literal runat="server" Text='<%# Eval("makename") %>' />
                            &nbsp;
                            <asp:Literal runat="server" Text='<%# Eval("modelname") %>' />
                            &nbsp;
                            <asp:Literal runat="server" Text='<%# Eval("first_reg_date") %>' />
                        </a></span>
                        <div class="p2" style="float: left; margin-left: 10px;">
                            <a href="carview.aspx?carid=<%# Eval("id") %>">
                                <asp:Image ID="Image1" runat="server" CssClass="style4" Height="60px" ImageUrl='<%# "UploadImages/"+ Eval("id") + "_001.jpg" %>'
                                    Width="80px" />
                            </a>
                        </div>
                        <div style="float: left; margin-left: 10px; width: 150px">
                            <asp:Label runat="server" Text='<%# Eval("vehicletype") %>'></asp:Label>
                            <br />
                            Gearbox:
                            <asp:Label runat="server" Text='<%# Eval("gearbox") %>'></asp:Label>
                            <br />
                            Fuel:
                            <asp:Label runat="server" Text='<%# Eval("fuel_type") %>'></asp:Label>
                            <br />
                            City:
                            <asp:Label runat="server" Text='<%# Eval("location_city") %>'></asp:Label>
                        </div>
                        <div style="float: left; margin-left: 10px; width: 100px">
                            <span class="block text-1">Mileage: <strong class="color-3">
                                <asp:Label runat="server" Text=' '></asp:Label>
                            </strong>|</span>
                        </div>
                         
                        <div style="float: right; margin-right: 10px;">
                            <span class="block text-1"></span><strong><b>$<asp:Label runat="server" Text='<%# Eval("price") %>'></b></asp:Label>
                            </strong>
                        </div>
                    </div>
                </ItemTemplate>
                <LayoutTemplate>
                    <table runat="server">
                        
                        <tr runat="server">
                            <td runat="server">
                                <table id="groupPlaceholderContainer" runat="server" border="0" style="">
                                    <tr id="groupPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr runat="server">
                            <td runat="server" style="text-align:center">
                                <asp:DataPager ID="DataPager1" runat="server" PageSize="25">
                                    <Fields>
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False"
                                            ShowPreviousPageButton="False" />
                                        <asp:NumericPagerField />
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False"
                                            ShowPreviousPageButton="False" />
                                    </Fields>
                                </asp:DataPager>
                            </td>
                        </tr>
                    </table>
                </LayoutTemplate>
            </asp:ListView>
        </div>
    </div></td></tr></table>
  
                 </ContentTemplate>
             </asp:UpdatePanel>
    <!--==============================content================================-->
    <section id="content">
                <div class="container_12">
              
                </div>
            </section>
  </asp:Content>
